﻿/*
 * ========================================================================
 * Copyright(c) 2008-2010北京高阳金信信息技术有限公司, All Rights Reserved.
 * ========================================================================
 *  客户基本信息WCF服务
 * 
 * 作者：张生     时间：2010年6月9日11:21:57
 * 版本：V1.0
 * 
 * 修改者： 张鹏         时间： 2010年6月11日10:07:57               
 * 修改说明：增加GetSingleUser
 * ========================================================================
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using NBFBLL;
using NBFModel;

namespace NBFWcfService
{
    // 注意: 如果更改此处的类名 "IUserInfoService"，也必须更新 Web.config 中对 "IUserInfoService" 的引用。
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class UserInfoService : IUserInfo
    {
        private UserListBLL ulistBll = new UserListBLL();
        #region IUserInfo 成员

        [WebGet(BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.TB_zdgl_Users> GetUserList(string strWhere)
        {
            return ulistBll.GetUserList(strWhere);
        }

        [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
        public NBFModel.TB_zdgl_Users GetSingleUser(string userID)
        {
            return ulistBll.GetSingleUser(userID);
        }

        [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
        public int InsertUser(TB_zdgl_Users usr)
        {
            return ulistBll.InsertUser(usr);
        }

        [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
        public int UpdateUser(TB_zdgl_Users usr)
        {
            return ulistBll.UpdateUser(usr);
        }

        [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
        public int DeleteUuser(string userid)
        {
            int num = ulistBll.DeleteUser(userid);
            return num;
        }

        #endregion
    }
}
